﻿Imports Microsoft.VisualBasic
Imports Microsoft.VisualStudio.TestTools.UnitTesting
Imports CustomTshirtFinal


<TestClass()> _
Public Class PedidoNegocioTest

    <TestMethod()> _
    Public Sub insertarTest()
        Dim negocio As New PedidoNegocio()

        Try
            Dim modelo = negocio.insertar(8, "10/04/2010", "1", 50)

            Console.Write(modelo.idPedido)

            'Assert.AreEqual(3, modelo.idPedido)

        Catch ex As DAOExcepcion
            Assert.Fail(ex.ToString())
        End Try

    End Sub

    <TestMethod()> _
    Public Sub eliminarTest()
        Dim modelo As PedidoNegocio = New PedidoNegocio()
        Dim idPedido As Integer = 10
        Try
            modelo.eliminar(idPedido)
        Catch ex As DAOExcepcion

            Assert.Fail(ex.ToString())
        End Try
    End Sub

    <TestMethod()> _
    Public Sub actualizarTest()
        Dim modelo As PedidoNegocio = New PedidoNegocio()

        Try
            modelo.actualizar(11, "10/02/2012", "1", "100")

        Catch ex As Exception
            Assert.Fail(ex.ToString())
        End Try
    End Sub


    <TestMethod()> _
    Public Sub buscarPorFechaTest()
        Dim negocio = New PedidoNegocio

        Try

            Dim modelo = negocio.buscarPorFecha("32/06/2012")
            MsgBox(modelo.Count)


        Catch ex As Exception
            Assert.Fail(ex.ToString())

        End Try
        
    End Sub
End Class
